<%@ page import="com.share.entity.Blog" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<title>首页</title>
</head>
<body>

<% List<Blog> blogs = (List<Blog>) request.getAttribute("blogs"); %>
<% for (int length = 0; length < blogs.size(); length++) {%>
<p><span>内容:<%=blogs.get(length).getContent()%></span>&nbsp;&nbsp; <span>时间:<%=blogs.get(length).getCreateTime()%></span>
	&nbsp;&nbsp; <span>评论数:<%=blogs.get(length).getCommentNum()%></span>
	<a href="/comment/add?id=<%=blogs.get(length).getId()%>">评论</a>
</p>
<%}%>

<% if (session.getAttribute("user") == null) {%>
<div><a href="/login"> 登录</a>&nbsp;&nbsp;</div>
<%}%><a href="/blog/add">添加</a>&nbsp;<a href="/logout">退出</a>
</body>
</html>
